<?
include('../variables.php');
$save_type="MySQL";

if($_SERVER['QUERY_STRING']){
        $params = decode_params();
        if($params){
                while(list($key,$value) = each($params)){
                        $$key  = $value;
                }

        }
        $params = "";
}

$dbh = get_master_connect();
if (!$dbh) {
	 			$errorMsg = translate('cannot_process_request');
				include_once('errorMsg.html');	
//      echo "We are sorry but we cannot process your request at the moment<BR>";
        exit_now();
}
//print_r(get_reseller_service_prices(28));exit;
for($id=27501;$id<27620;$id++){
	$data = get_reseller_service_prices($id);
	if(!is_array($data)) echo "get_services_broke:	$id\n";
        foreach($data as $p=>$price){
		$name='';
                switch($p){
                        case "disk_space_price":
                                $new['1']['USD'] = $price;
                                $new['12']['USD'] = $price*12;
                                $name = "disk_space";
                        break;
                        case "traffic_price":
                                $new['1']['USD'] = $price;
                                $new['12']['USD'] = $price*12;
                                $name = "traffic";
                        break;
                        case "domain_price":
                                $new['1']['USD'] = $price;
                                $new['12']['USD'] = $price*12;
                                $name = "domain";
                        break;
                        case "ip_price":
                                $new['1']['USD'] = $price;
                                $new['12']['USD'] = $price*12;
                                $name = "ip";
                        break;
                        case "db_price":
                                $new['1']['USD'] = $price;
                                $new['12']['USD'] = $price*12;
                                $name = "sql";
                        break;
                        case "db_space_price":
                                $new['1']['USD'] = $price;
                                $new['12']['USD'] = $price*12;
                                $name = "sql_quota";
                        break;
                        case "ssh_price":
                                $new['1']['USD'] = $price;
                                $new['12']['USD'] = $price;
                                $name = "ssh";
                        break;
                        case "registerdomain_price":
                                $new['12']['USD'] = $price;
				$new['1']['USD'] = $price;
				$name='registerdomain';
				$q = "UPDATE products set price='".base64_encode(serialize($new))."' where reseller_id='$id' and type='$name';";
                        break;

                }
		if(!$q && $name)
	                $q = "UPDATE products set price='".base64_encode(serialize($new))."' where reseller_id='$id' and name='$name' and type='service';";
		if($q) `echo "$q" >> duplicate_services_queries.txt`;
		$q='';
                $new = "";
                $name = "";
        }
	
}
		
?>
